package com.hankol.newretail.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.baselibrary.base.BasicListBean
import com.hankol.newretail.bean.EvaluationBean
import com.hankol.newretail.bean.EvaluationConfigBean
import com.hankol.newretail.bean.PublishEvaluationBean
import com.hankol.newretail.respository.NewReatilRequestManager

/**评价相关
 * @author: merbng
 * @time: 2022/8/5 9:56
 * @description:
 */
class EvaluationViewModel : ViewModel() {
    var myEvaluationDataLD: MutableLiveData<BasicListBean<EvaluationBean>> = MutableLiveData()
    var evaluationConfigBeanLD: MutableLiveData<EvaluationConfigBean> = MutableLiveData()
    var addEvaluationBeanLD: MutableLiveData<PublishEvaluationBean> = MutableLiveData()

    //我的评价 0待评价，1已评价
    fun requestMyEvaluationList(type: Int, page: Int) {
        NewReatilRequestManager.getInstance().requestMyEvaluationList(myEvaluationDataLD, type, page)
    }

    //评价配置信息
    fun requestEvaluationConfig(productInfo: Int) {
        NewReatilRequestManager.getInstance().requestEvaluationConfig(evaluationConfigBeanLD, productInfo)
    }

    //评价配置信息
    fun requestAddEvaluation(json: String) {
        NewReatilRequestManager.getInstance().requestAddEvaluation(addEvaluationBeanLD, json)
    }
}